﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace eLuk.Entity
{
	[KnownType( typeof( EmailAccount ) )]
	[DataContract( IsReference = true )]
	public class eLukFolder : eLukObject
	{
		[DataMember]
		public string Name { get; set; }

		[DataMember]
		public long Recent { get; set; }

		[DataMember]
		public string DisplayName { get; set; }

		[DataMember]
		public string DisplayInfo { get; set; }

		[DataMember]
		public long UIDNext { get; set; }

		[DataMember]
		public bool HasSubfolder { get; set; }

		[DataMember]
		public bool NoSelect { get; set; }

		[DataMember]
		public long HighestModSequence { get; set; }
		public void Sync()
		{

		}

		[DataMember]
		public FolderFlags FolderFlags { get; set; }

		//public FolderFlags FolderPermanentFlags { get; set; }
		[DataMember]
		public long Exists { get; set; }

		[DataMember]
		public FolderFlags FolderPermanentFlags { get; set; }

		[DataMember]
		public long UIDValidatity { get; set; }

		[DataMember]
		public eLukFolder ParentFolder { get; set; }

		[DataMember]
		public eLukFolders SubFolders { get; set; }

		[DataMember]
		public MailMessages MailMessages { get; set; }

		[DataMember]
		public bool IsRoot { get; set; }

		public eLukFolder( string Name )
			: this()
		{
			this.Name = Name;
		}

		public eLukFolder( string Name, string DisplayName )
			: this( Name )
		{
			this.DisplayName = this.DisplayName;
		}


		public eLukFolder()
		{
			this.IsRoot = false;
		}
	}

	[CollectionDataContract( IsReference = true )]
	public class eLukFolders : List<eLukFolder>
	{
		public void Sync()
		{

		}

	}

	[DataContract]
	[Flags]
	public enum FolderFlags : int
	{
		[EnumMember]
		Answered = 1,
		[EnumMember]
		Flagged = 1 << 1,
		[EnumMember]
		Draft = 1 << 2,
		[EnumMember]
		Deleted = 1 << 3,
		[EnumMember]
		Seen = 1 << 4,
		[EnumMember]
		Phishing = 1 << 5,
		[EnumMember]
		NotPhishing = 1 << 6
	}

}
